<?php
include_once('common/header.php');
if($AppUI->id <= 0 || (isset($_SESSION['education']) && ($_SESSION['education'] <= 0))) {
	$this->_redirect(HOST_BACKEND);
}
$intEducateId	= $objRequest->getParam('eduid', 0);
$strKey			= $objRequest->getParam('key', '');
$strStart		= $objRequest->getParam('startdate', '');
$strEnd			= $objRequest->getParam('enddate', '');
$intPage		= $objRequest->getParam('page', 1);
$intCancel		= $objRequest->getParam('pcancel', 0);
$intLimit		= ADMIN_LIMIT;
$intOff			= (($intPage-1) * $intLimit);
$intTotal		= 0;
$intType		= 0;
$objEducation	= new Education(); 
if($intCancel) {
	$strKey		= '';
	$strStart	= '';
	$strEnd		= '';
}
$arrResult		= $objEducation->getAllCmt($intEducateId, $strKey, Ecore_Function::convertStrToDate($strStart), Ecore_Function::convertStrToDate($strEnd), $intOff, $intLimit, $intTotal);
if($strKey != '' || $strStart != '' || $strEnd != '') {
	$_SESSION['cmtecancel'] 	= 1;	
	$_SESSION['cmtepost']	= $objRequest->getParams();
}
else {
	if(isset($_SESSION['cmtepost'])) unset($_SESSION['cmtepost']);
	if(isset($_SESSION['cmtecancel'])) unset($_SESSION['cmtecancel']);
}
if($intCancel) {
	if(isset($_SESSION['cmtepost'])) unset($_SESSION['cmtepost']);
	if(isset($_SESSION['cmtecancel'])) unset($_SESSION['cmtecancel']);
}
if($intEducateId > 0) {
	$this->view->arrEdu		= $objEducation->get($intEducateId);
}
# list
$this->view->arrResult		= $arrResult;
$this->view->intTotal		= $intTotal;
$this->view->intOffset		= $intOff;
$this->view->intLimit		= $intLimit;
$this->view->strUrl			= Ecore_Function::getUrl(HOST_BACKEND);